package com.qzimp.fujiancuo.controller;

import com.qzimp.fujiancuo.entity.ArticleCat;
import com.qzimp.fujiancuo.service.ArticleCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @className:ArticleCatController
 * @desc 前端控制方法：1 all 2 one 3 add 4 del 5 edit 6 page  7 addBatch 7 root 8 children，
 *                  9 sear
/*chCatNameLike,10 checkCatName,11 getArticleCatsByShowInNav 12 sort,
 * @author:wuzongbo
 * @date: 2023/7/13
 **/
@RestController
@RequestMapping("/api/articlecat")
public class ArticleCatController {
    @Autowired
    private ArticleCatService articleCatService;




    /**
     * 添加数据 @Validated 激活验证
     * @param articleCat 实例
     * @return 添加是否成功 true 成功
     */
    @PostMapping("/add")
    public  boolean add(@Validated @RequestBody ArticleCat articleCat){
        return articleCatService.save(articleCat);
    }
    @DeleteMapping("/delete/{id}")
    public boolean delete(@PathVariable Integer id){
        return true;
    }


}